<?php

/**
 * alumno form base class.
 *
 * @method alumno getObject() Returns the current form's model object
 *
 * @package    sistema_itec_new
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BasealumnoForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'persona_id'                   => new sfWidgetFormInputHidden(),
      'calle'                        => new sfWidgetFormInputText(),
      'numero'                       => new sfWidgetFormInputText(),
      'telefono'                     => new sfWidgetFormInputText(),
      'trabaja'                      => new sfWidgetFormInputText(),
      'experiencia_laboral'          => new sfWidgetFormInputText(),
      'rubro'                        => new sfWidgetFormInputText(),
      'funcion'                      => new sfWidgetFormInputText(),
      'localidad_id'                 => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Localidad'), 'add_empty' => true)),
      'estado_administrativo_inicio' => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Estado'), 'add_empty' => false)),
      'estado_administrativo_actual' => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Estado_2'), 'add_empty' => false)),
      'estado_economico_inicio'      => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Estado_3'), 'add_empty' => false)),
      'estado_economico_actual'      => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Estado_4'), 'add_empty' => false)),
      'estado_academico_actual'      => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Estado_5'), 'add_empty' => false)),
      'observaciones_documentacion'  => new sfWidgetFormInputText(),
    ));

    $this->setValidators(array(
      'persona_id'                   => new sfValidatorChoice(array('choices' => array($this->getObject()->get('persona_id')), 'empty_value' => $this->getObject()->get('persona_id'), 'required' => false)),
      'calle'                        => new sfValidatorString(array('max_length' => 100, 'required' => false)),
      'numero'                       => new sfValidatorString(array('max_length' => 5, 'required' => false)),
      'telefono'                     => new sfValidatorString(array('max_length' => 15, 'required' => false)),
      'trabaja'                      => new sfValidatorInteger(),
      'experiencia_laboral'          => new sfValidatorInteger(),
      'rubro'                        => new sfValidatorString(array('max_length' => 45, 'required' => false)),
      'funcion'                      => new sfValidatorString(array('max_length' => 45, 'required' => false)),
      'localidad_id'                 => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Localidad'), 'required' => false)),
      'estado_administrativo_inicio' => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Estado'))),
      'estado_administrativo_actual' => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Estado_2'))),
      'estado_economico_inicio'      => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Estado_3'))),
      'estado_economico_actual'      => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Estado_4'))),
      'estado_academico_actual'      => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Estado_5'))),
      'observaciones_documentacion'  => new sfValidatorString(array('max_length' => 255, 'required' => false)),
    ));

    $this->widgetSchema->setNameFormat('alumno[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'alumno';
  }

}
